package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.dto.NursingLevelDto;
import com.zzyl.entity.NursingLevel;
import com.zzyl.vo.NursingLevelVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * ClassName:NursingLevelMapper
 * package:com.zzyl.mapper
 * description:
 *
 * @author 刘
 * @version 1.0
 * @Create 2024/6/2 10:25
 */
@Mapper
public interface NursingLevelMapper {

    //查询全部护理等级
    @Select("select * from nursing_level")
    List<NursingLevelVo> getAllLevel();

    //新增
    void insertLevel(NursingLevel nursingLevel);

    //条件分页查询
    Page<NursingLevelVo> selectByLimit(String name, Integer status);

    //根据id查询
    NursingLevelVo selectById(Integer id);

    //编辑修改
    void updateLevel(NursingLevel nursingLevel);

    //删除
    @Delete("delete from nursing_level where id = #{id}")
    void deleteLevel(Integer id);

    //禁用启用
    @Update("update nursing_level set status = #{status} where id = #{id}")
    void updateStatusById(Integer id, Integer status);
}
